package org.jeecg.modules.bigdatashow.controller;

import org.jeecg.modules.bigdatashow.entity.Constitute;
import org.jeecg.modules.bigdatashow.entity.Month;
import org.jeecg.modules.bigdatashow.entity.Statistics;
import org.jeecg.modules.bigdatashow.service.ProfitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping(value = "/Y",produces = "application/json; charset=utf-8")
public class ProfitController {
    @Autowired
    ProfitService profitService;

       @GetMapping("/st")
      public Statistics st(){
        Statistics statistics=profitService.find();
        return statistics;
      }

      @GetMapping("/xiao")
      public List<Constitute> list(){
      List<Constitute> list=profitService.findByType(1);
     return list;
      }

    @GetMapping("/tou")
    public List<Constitute> Tr(){
        List<Constitute> list=profitService.findByType(2);
        return list;
    }


     @GetMapping("/month")
    public  List<Month> Month(){
           List<Month> moneyList=profitService.findAll();
         return moneyList;
     }


}
